const fs = require('fs');
const path = require('path');

// 搜索目录
const searchDir = path.join(__dirname, 'app');

// 检查文件中是否使用了message组件
function checkMessageUsage(dir) {
  const files = fs.readdirSync(dir);
  
  files.forEach(file => {
    const fullPath = path.join(dir, file);
    const stat = fs.statSync(fullPath);
    
    if (stat.isDirectory() && !file.startsWith('.')) {
      checkMessageUsage(fullPath);
    } else if (file.endsWith('.tsx') || file.endsWith('.jsx')) {
      const content = fs.readFileSync(fullPath, 'utf8');
      if (content.includes('message.') || (content.includes('import') && content.includes('message'))) {
        console.log(`可能存在message组件使用: ${fullPath}`);
        
        // 检查是否已经导入了notification但还在使用message
        if (content.includes('notification') && content.includes('message.')) {
          console.log(`  - 已导入notification但仍使用message`);
        }
      }
    }
  });
}

console.log('开始检查message组件使用情况...');
checkMessageUsage(searchDir);
console.log('检查完成');